package com.dxf.service;

import com.dxf.entity.Student;

import java.util.HashMap;
import java.util.Map;

public class StudentFactory {

    private static Map<Integer, Student> map  = new HashMap<>();

    static {
        map.put(1,new Student(0,"张三",10,"小学生"));
        map.put(2,new Student(0,"李四",14,"中学生"));
        map.put(3,new Student(0,"王五",19,"大学生"));

    }


    public static Student getStudentById(Integer id){
        return map.get(id);
    }

    public Student getdyStudent(Integer id,String name,Integer age,String grade) {
        return new Student(id,name,age,grade);
    }
}
